package com.farm.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;

import com.farm.entity.Product;
import com.farm.entity.User;

public interface ProductRepository extends JpaRepository<Product, Long> {
    List<Product> findByFarmer(User farmer);
    List<Product> findByApproved(boolean approved);
    List<Product> findByCategory(String category);
    List<Product> findByCategoryAndApproved(String category, boolean approved);
    List<Product> findByNameContaining(String keyword);
    List<Product> findByNameContainingAndCategory(String keyword, String category);
    List<Product> findByNameContainingAndApproved(String keyword, boolean approved);
    List<Product> findByNameContainingAndCategoryAndApproved(String keyword, String category, boolean approved);
} 